﻿@model SmallJob.Model.User
@{
    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Details</h2>

<fieldset>
    <legend>User</legend>
    @if (string.IsNullOrWhiteSpace(Model.FbID))
    {
        <p>Account Type : Viecnho.com Account</p>
    }
    else
    {
        <p>Account Type : Facebook Account</p>
    }
    <p>Email : @Model.Email</p>
    <p>Name : @Model.ProperName</p>
    <p>Store Name : @Model.UserName</p>
    <p>Is Lock : @Model.IsLock</p>
    <p>Location : @Model.Location</p>
    <p>Join Date : @Model.JoinDate</p>
    <p>
        Avatar :
        <img src="@Model.Avatar"/>
    </p>
    <p>Info : @Model.Info</p>
    <p>
        <a href="javascript:;" onclick="reset(@Model.ID)" >Reset Password</a>
    </p>
</fieldset>
<p>
    @Html.ActionLink("Back to List", "Index")
</p>
<script type="text/javascript">
    function reset(id) {
        if(confirm("Reset password à ?"))
            $.post('@Url.Action("ResetPassword", "user")', { id: id }, function (data) {
                if (data) {
                    alert("Xong !");
                }
        });
    }
</script>
